//
//  WXSDK.h
//  mobileGo
//
//  Created by cqck on 2017/12/11.
//  Copyright © 2017年 cqck. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, LYWXResult) {
    LYWXResultSuccess,
    LYWXResultFail,
    LYWXResultCancel,
};

typedef void(^LYWXResultCallback)(LYWXResult result);

@interface LYWechatSDK : NSObject

+ (instancetype)sharedInstance;

/*!
 * @brief             注册微信
 * @param   wxAppId   微信appid
 */
- (void)registerWx:(NSString *)wxAppId universalLink:(NSString *)link;

/*!
 * @brief             是否安装微信
 */
- (BOOL)isInstallWX;

- (BOOL)handleWxOpenUrl:(NSURL *)url;

- (BOOL)handleWxActiveUrl:(NSUserActivity *)activity;

/*!
 * @brief                分享朋友
 * @param   title        分享标题
 * @param   content      分享内容
 * @param   image        分享图片
 * @param   url          分享链接
 * @param   callback     分享状态回调
 */
- (void)shareWxFriendWithTitle:(NSString *)title
                       content:(NSString *)content
                         image:(UIImage *)image
                           url:(NSString *)url
                resultCallback:(LYWXResultCallback)callback;

/*!
 * @brief                分享朋友圈
 * @param   title        分享标题
 * @param   content      分享内容
 * @param   image        分享图片
 * @param   url          分享链接
 * @param   callback     分享状态回调
 */
- (void)shareWxTimelineWithTitle:(NSString *)title
                         content:(NSString *)content
                           image:(UIImage *)image
                             url:(NSString *)url
                  resultCallback:(LYWXResultCallback)callback;

- (void)payWithPartnerId:(NSString *)partnerId prepayId:(NSString *)prepayId package:(NSString *)package nonceStr:(NSString *)nonceStr timestamp:(int)timestamp sign:(NSString *)sign resultCallback:(LYWXResultCallback)callback;

@end
